package example1;

/**
 * <h3>designPattern</h3>
 * <p>邮件发送工厂：FactoryPattern</p>
 * @author : zhang.bw
 * @date : 2021-02-25 14:17
 **/
public class FactoryPattern {
	public static Sender produce(Type type) {
		switch (type) {
			case MAIL:
				return new MailSender();
			case SMS:
				return new SmsSender();
			default:
				return null;
		}
	}
}
